package com.young.shop.pojo.entity;

import org.springframework.stereotype.Repository;

import java.util.Objects;

/**
 * @author 曾家乐
 * @version 1.0
 * @date 2021-01-11 12:23
 * 地址对象
 */
@Repository
public class Address {
    private long id;
    private long userId;
    private String name;
    private String phone;
    private String province;
    private String city;
    private String dist;
    private String address;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Address address1 = (Address) o;
        return userId == address1.userId &&
                Objects.equals(name , address1.name) &&
                Objects.equals(phone , address1.phone) &&
                Objects.equals(province , address1.province) &&
                Objects.equals(city , address1.city) &&
                Objects.equals(dist , address1.dist) &&
                Objects.equals(address , address1.address);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name , phone , province , city , dist , address);
    }

    @Override
    public String toString() {
        return "Address{" +
                "id=" + id +
                ", userId=" + userId +
                ", name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", dist='" + dist + '\'' +
                ", address='" + address + '\'' +
                '}';
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDist() {
        return dist;
    }

    public void setDist(String dist) {
        this.dist = dist;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
